Skip to content

feat(frametests): add WithBoundHTTPTestDriver - #697

Merged
pitabwire merged 1 commit into
mainfrom
feat/frametests-bound-http-test-driver
Aug 31, 2026
Merged

feat(frametests): add WithBoundHTTPTestDriver#697
pitabwire merged 1 commit into
mainfrom
feat/frametests-bound-http-test-driver

Conversation

@pitabwire

Copy link
Copy Markdown
Owner

Adds a bound-address variant of the httptest driver: binds the address frame derives from HTTPServerPort (synchronously, on the caller's goroutine) so Service.Run surfaces listen/startup errors directly and peers configured with the service URL before startup (Hydra login/consent redirects, token-hook webhooks) can reach the suite service. No behaviour change to WithHTTPTestDriver (regression-tested).

First consumer: antinvestor/service-authentication test suites (currently carrying a local copy in pkg/tests/http_driver.go pending this release).

https://claude.ai/code/session_01XhqbaQcsAVEiTorq8uSyt6

WithHTTPTestDriver lets httptest pick a random loopback port, which does
not work when peers must be configured with the service URL before the
service starts (e.g. Ory Hydra login/consent redirects and token-hook
webhooks in integration suites). WithBoundHTTPTestDriver binds the
address frame derives from HTTPServerPort, on the caller's goroutine, so
Service.Run returns listen and startup errors synchronously — test
suites need no go func()/readiness polling around Run.

WithHTTPTestDriver behaviour is unchanged (covered by a regression
test).

Claude-Session: https://claude.ai/code/session_01XhqbaQcsAVEiTorq8uSyt6
@pitabwire
pitabwire merged commit 0a154de into main Aug 31, 2026
5 checks passed
@pitabwire
pitabwire deleted the feat/frametests-bound-http-test-driver branch August 31, 2026 16:40
pitabwire added a commit to antinvestor/service-authentication that referenced this pull request Aug 31, 2026
frame v2.1.7 ships the bound-address httptest driver upstream
(pitabwire/frame#697); use it for the suite-level auth service and drop
the interim local copy in pkg/tests/http_driver.go.

Claude-Session: https://claude.ai/code/session_01XhqbaQcsAVEiTorq8uSyt6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant